<template>
	<div class="search-parent">
		<div class="back-activity">
			<a v-link="{path: '/result/' + activityId }" class="btn btn-sm btn-primary">返回活动</a>
		</div>
		<form class="form-inline text-right search-result" @submit.prevent="submit">
	    <div class="form-group form-group-sm">
				<div class="wrap-item">
					<label class="control-label">*奖品名称</label>
					<select class="form-control" v-model="currentName">
						<option :value="it" v-for="it in prizeNList">{{it}}</option>
					</select>
				</div>
				<div v-show="!isTingSui" class="wrap-item">
					<label class="control-label">*课程名</label>
					<select class="form-control" v-model="form.courseId">
						<option value="">请选择</option>
						<option v-for="it in courseList" value="{{it.key}}">{{it.value}}</option>
					</select>
				</div>
				<div v-show="!isTingSui" class="wrap-item">
				<label class="control-label">*课程时长</label>
					<select class="form-control" v-model="form.dateNum">
						<option value="">请选择</option>
						<option v-for="it in courseDuration" value="{{it.key}}">{{it.value}}</option>
					</select>
				</div>
	      <input type="submit" class="btn btn-sm btn-primary" value="发放课程">
	    </div>
	  </form>
	</div>

	<table class="table table-bordered table-hover">
		<thead>
			<tr>
				<th class="col-sm-2"><input type="checkbox" v-model="checkAll">奖品名称</th>
				<th class="col-sm-2">中奖手机号码</th>
				<th class="col-sm-2">奖品类型</th>
				<th class="col-sm-2">发奖状态</th>
			</tr>
		</thead>
		<tbody>
			<tr v-for="prizeResult in notSendList">
				<td><input type="checkbox" value={{prizeResult.id}} v-model="checkedIds" v-if="+prizeResult.status === 1">{{prizeResult.name}}</td>
				<td>{{prizeResult.phone}}</td>
				<td>{{ prizeResult.type | CustomType}}</td>
				<td>{{+prizeResult.status === 1 ? '未发奖': '已发奖'}}</td>
			</tr>
			<tr v-for="prizeResult in sendList">
				<td><input type="checkbox" value={{prizeResult.id}} v-model="checkedIds" v-if="+prizeResult.status === 1">{{prizeResult.name}}</td>
				<td>{{prizeResult.phone}}</td>
				<td>{{ prizeResult.type | CustomType}}</td>
				<td>{{+prizeResult.status === 1 ? '未发奖': '已发奖'}}</td>
			</tr>
		</tbody>
	</table>
	<vue-pages :pages.sync="pages" :get-list="getCurrentList"></vue-pages>
</template>
<style src="./course-manage.css" scoped></style>
<script src="./course-manage.js"></script>
